package com.ruoyi.ifmReward.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ifmReward.mapper.IfmRewardMapper;
import com.ruoyi.ifmReward.domain.IfmReward;
import com.ruoyi.ifmReward.service.IIfmRewardService;

/**
 * 奖励Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-01
 */
@Service
public class IfmRewardServiceImpl implements IIfmRewardService 
{
    @Autowired
    private IfmRewardMapper ifmRewardMapper;

    /**
     * 查询奖励
     * 
     * @param rewardId 奖励主键
     * @return 奖励
     */
    @Override
    public IfmReward selectIfmRewardByRewardId(Long rewardId)
    {
        return ifmRewardMapper.selectIfmRewardByRewardId(rewardId);
    }

    /**
     * 查询奖励列表
     * 
     * @param ifmReward 奖励
     * @return 奖励
     */
    @Override
    public List<IfmReward> selectIfmRewardList(IfmReward ifmReward)
    {
        return ifmRewardMapper.selectIfmRewardList(ifmReward);
    }

    /**
     * 新增奖励
     * 
     * @param ifmReward 奖励
     * @return 结果
     */
    @Override
    public int insertIfmReward(IfmReward ifmReward)
    {
        ifmReward.setCreateTime(DateUtils.getNowDate());
        return ifmRewardMapper.insertIfmReward(ifmReward);
    }

    /**
     * 修改奖励
     * 
     * @param ifmReward 奖励
     * @return 结果
     */
    @Override
    public int updateIfmReward(IfmReward ifmReward)
    {
        ifmReward.setUpdateTime(DateUtils.getNowDate());
        return ifmRewardMapper.updateIfmReward(ifmReward);
    }

    /**
     * 批量删除奖励
     * 
     * @param rewardIds 需要删除的奖励主键
     * @return 结果
     */
    @Override
    public int deleteIfmRewardByRewardIds(Long[] rewardIds)
    {
        return ifmRewardMapper.deleteIfmRewardByRewardIds(rewardIds);
    }

    /**
     * 删除奖励信息
     * 
     * @param rewardId 奖励主键
     * @return 结果
     */
    @Override
    public int deleteIfmRewardByRewardId(Long rewardId)
    {
        return ifmRewardMapper.deleteIfmRewardByRewardId(rewardId);
    }
}
